package com.ybkj.o2o.mc.entity;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

import com.ybkj.o2o.mc.common.DateField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

public class Passenger extends AccountBase implements Serializable {

	private Long id;

	private String name;// 乘客姓名

	private String password;//密码
	
	private String phone;// 乘客电话
	
	private String jobNumber;//工号

	private Double receiptMoney;// 可开票金额

	@JsonProperty("enterprise_id")
	private Long enterpriseId;// 所属企业Id

	@JsonProperty("enterprise_name")
	private String enterpriseName;// 所属企业名称

	private Long departmentId;// 关联部门id

	private String departmentName;// 部门名称

	private String plateNumber;// 车牌号

	private String photo;// 头像地址

	@JsonProperty("grade_id")
	private Long gradeId;// 级别Id

	@JsonProperty("grade_name")
	private String gradeName;// 级别名称

	private Boolean inBlackList;// 是否为黑名单乘客

	private Integer type;// 类型:0个人,1企业

	private String idcard;// 身份证号码

	private Integer gender;// 性别

	private String email;// 邮箱

	private String memo;// 备注

	private Double latitude;// 纬度

	private Double longitude;// 经度

	private Long drivingNumberTimes;// 代驾次数

	private String deviceType; // 设备类型

	private Double mileage;// 累计里程(每单里程累加结果)

	private String address;// 简单地址:如(翰林世家)

	@JsonSerialize(using = DateField.class)
	private Date created; // 注册时间

	@JsonSerialize(using = DateField.class)
	private Date updated;

	private Integer version;// 操作版本
	
	@JsonProperty("channel_id")
	private Long channelId;// 渠道Id
	
	@JsonProperty("channel_name")
	private String channelName;// 渠道名称

	private String appKey;// 用于区别系统

	private Long companyId;// 所属公司Id

	private String companyName;// 所属公司名称

	private String introducer;// 推荐人

	private Integer introduceType;// 推荐人类型：0客户,1司机

	private String appVersion;// app版本

	private String wxHeadImgUrl;//微信头像

	private String wxNickName;//微信昵称

	@Override
	public String toString() {
		return "Passenger{" +
				"id=" + id +
				", name='" + name + '\'' +
				", password='" + password + '\'' +
				", phone='" + phone + '\'' +
				", jobNumber='" + jobNumber + '\'' +
				", receiptMoney=" + receiptMoney +
				", enterpriseId=" + enterpriseId +
				", enterpriseName='" + enterpriseName + '\'' +
				", departmentId=" + departmentId +
				", departmentName='" + departmentName + '\'' +
				", plateNumber='" + plateNumber + '\'' +
				", photo='" + photo + '\'' +
				", gradeId=" + gradeId +
				", gradeName='" + gradeName + '\'' +
				", inBlackList=" + inBlackList +
				", type=" + type +
				", idcard='" + idcard + '\'' +
				", gender=" + gender +
				", email='" + email + '\'' +
				", memo='" + memo + '\'' +
				", latitude=" + latitude +
				", longitude=" + longitude +
				", drivingNumberTimes=" + drivingNumberTimes +
				", deviceType='" + deviceType + '\'' +
				", mileage=" + mileage +
				", address='" + address + '\'' +
				", created=" + created +
				", updated=" + updated +
				", version=" + version +
				", channelId=" + channelId +
				", channelName='" + channelName + '\'' +
				", appKey='" + appKey + '\'' +
				", companyId=" + companyId +
				", companyName='" + companyName + '\'' +
				", introducer='" + introducer + '\'' +
				", introduceType=" + introduceType +
				", appVersion='" + appVersion + '\'' +
				", wxHeadImgUrl='" + wxHeadImgUrl + '\'' +
				", wxNickName='" + wxNickName + '\'' +
				", passengerGrade=" + passengerGrade +
				", upStatus=" + upStatus +
				", reward=" + reward +
				", photoAuditStatus=" + photoAuditStatus +
				", daijiaFinishTime=" + daijiaFinishTime +
				", errandFinishTime=" + errandFinishTime +
				", freightFinishTime=" + freightFinishTime +
				", zhuancheFinishTime=" + zhuancheFinishTime +
				", zhuanxianFinishTime=" + zhuanxianFinishTime +
				", idCardPhoto='" + idCardPhoto + '\'' +
				", idCardBackPhoto='" + idCardBackPhoto + '\'' +
				'}';
	}

	private PassengerGrade passengerGrade;
	
	private Integer upStatus;//监管平台上传开关

    private Integer reward;//是否能够获取一次性奖励
	/**
	 * 小鹏 头像审核状态 0审核通过，1审核中，2审核未通过
	 */
		private Integer photoAuditStatus;

	public Integer getPhotoAuditStatus() {
		return photoAuditStatus;
	}

	public void setPhotoAuditStatus(Integer photoAuditStatus) {
		this.photoAuditStatus = photoAuditStatus;
	}

	public Integer getUpStatus() {
		return upStatus;
	}

	public void setUpStatus(Integer upStatus) {
		this.upStatus = upStatus;
	}
	@JsonSerialize(using = DateField.class)
	private Date daijiaFinishTime;

	@JsonSerialize(using = DateField.class)
	private Date errandFinishTime;
	
	@JsonSerialize(using = DateField.class)
	private Date freightFinishTime;
	
	@JsonSerialize(using = DateField.class)
	private Date zhuancheFinishTime;
	
	@JsonSerialize(using = DateField.class)
	private Date zhuanxianFinishTime;

	private String idCardPhoto;//身份证照片
	private String idCardBackPhoto;//身份证背面照片

	public String getIdCardPhoto() {
		return idCardPhoto;
	}

	public void setIdCardPhoto(String idCardPhoto) {
		this.idCardPhoto = idCardPhoto;
	}

	public String getIdCardBackPhoto() {
		return idCardBackPhoto;
	}

	public void setIdCardBackPhoto(String idCardBackPhoto) {
		this.idCardBackPhoto = idCardBackPhoto;
	}

	public PassengerGrade getPassengerGrade() {
		return passengerGrade;
	}

	public void setPassengerGrade(PassengerGrade passengerGrade) {
		this.passengerGrade = passengerGrade;
	}

	private static final long serialVersionUID = 1L;

	public String getAppVersion() {
		return appVersion;
	}

	public void setAppVersion(String appVersion) {
		this.appVersion = appVersion;
	}

	public Long getDrivingNumberTimes() {
		return drivingNumberTimes == null ? 0 : drivingNumberTimes;
	}

	public void setDrivingNumberTimes(Long drivingNumberTimes) {
		this.drivingNumberTimes = drivingNumberTimes;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * 返回乘客名称.
	 *
	 * @return 为null则返回空
	 */
	public String getName() {
		if (StringUtils.isBlank(name)) {
			return "";
		}
		return name;
	}

	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone == null ? null : phone.trim();
	}

	public String getPlateNumber() {
		return plateNumber;
	}

	public void setPlateNumber(String plateNumber) {
		this.plateNumber = plateNumber == null ? null : plateNumber.trim();
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo == null ? null : photo.trim();
	}

	public Boolean getInBlackList() {
		return inBlackList;
	}

	public void setInBlackList(Boolean inBlackList) {
		this.inBlackList = inBlackList;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard == null ? null : idcard.trim();
	}

	public Integer getGender() {
		return gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email == null ? null : email.trim();
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo == null ? null : memo.trim();
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address == null ? null : address.trim();
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public Long getChannelId() {
		return channelId;
	}

	public void setChannelId(Long channelId) {
		this.channelId = channelId;
	}

	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getAppKey() {
		return appKey;
	}

	public void setAppKey(String appKey) {
		this.appKey = appKey == null ? null : appKey.trim();
	}

	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName == null ? null : companyName.trim();
	}

	public String getIntroducer() {
		return introducer;
	}

	public void setIntroducer(String introducer) {
		this.introducer = introducer == null ? null : introducer.trim();
	}

	public Integer getIntroduceType() {
		return introduceType;
	}

	public void setIntroduceType(Integer introduceType) {
		this.introduceType = introduceType;
	}

	public Long getEnterpriseId() {
		return enterpriseId;
	}

	public void setEnterpriseId(Long enterpriseId) {
		this.enterpriseId = enterpriseId;
	}

	public String getEnterpriseName() {
		return enterpriseName;
	}

	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}

	public Long getGradeId() {
		return gradeId;
	}

	public void setGradeId(Long gradeId) {
		this.gradeId = gradeId;
	}

	public String getGradeName() {
		return gradeName;
	}

	public void setGradeName(String gradeName) {
		this.gradeName = gradeName;
	}

	public Double getMileage() {
		return mileage;
	}

	public void setMileage(Double mileage) {
		this.mileage = mileage;
	}

	public String getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(String deviceType) {
		this.deviceType = deviceType;
	}

	public Double getReceiptMoney() {
		return receiptMoney != null ? receiptMoney : 0.0;
	}

	public void setReceiptMoney(Double receiptMoney) {
		this.receiptMoney = receiptMoney;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null || getClass() != obj.getClass()) {
			return false;
		}

		Passenger passenger = (Passenger) obj;

		if (!appKey.equals(passenger.appKey)) {
			return false;
		}

		if (id != null && passenger.id != null) {
			if (id.equals(passenger.id)) {
				return true;
			}
		}

		if (phone != null && passenger.phone != null) {
			if (phone.equals(passenger.phone)) {
				return true;
			}
		}

		return false;
	}

	public Long getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(Long departmentId) {
		this.departmentId = departmentId;
	}

	public String getDepartmentName() {
		return departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	@Override
	public int hashCode() {
		int result = id != null ? id.hashCode() : 0;
		result = 31 * result + (phone != null ? phone.hashCode() : 0);
		return result;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getJobNumber() {
		return jobNumber;
	}

	public void setJobNumber(String jobNumber) {
		this.jobNumber = jobNumber;
	}

	public Date getDaijiaFinishTime() {
		return daijiaFinishTime;
	}

	public void setDaijiaFinishTime(Date daijiaFinishTime) {
		this.daijiaFinishTime = daijiaFinishTime;
	}

	public Date getErrandFinishTime() {
		return errandFinishTime;
	}

	public void setErrandFinishTime(Date errandFinishTime) {
		this.errandFinishTime = errandFinishTime;
	}

	public Date getFreightFinishTime() {
		return freightFinishTime;
	}

	public void setFreightFinishTime(Date freightFinishTime) {
		this.freightFinishTime = freightFinishTime;
	}

	public Date getZhuancheFinishTime() {
		return zhuancheFinishTime;
	}

	public void setZhuancheFinishTime(Date zhuancheFinishTime) {
		this.zhuancheFinishTime = zhuancheFinishTime;
	}

	public Date getZhuanxianFinishTime() {
		return zhuanxianFinishTime;
	}

	public void setZhuanxianFinishTime(Date zhuanxianFinishTime) {
		this.zhuanxianFinishTime = zhuanxianFinishTime;
	}

    public Integer getReward() {
        return reward;
    }

    public void setReward(Integer reward) {
        this.reward = reward;
    }

	public String getWxHeadImgUrl() {
		return wxHeadImgUrl;
	}

	public void setWxHeadImgUrl(String wxHeadImgUrl) {
		this.wxHeadImgUrl = wxHeadImgUrl;
	}

	public String getWxNickName() {
		return wxNickName;
	}

	public void setWxNickName(String wxNickName) {
		this.wxNickName = wxNickName;
	}
}
